import collections
class Solution(object):
    def majorityElement(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        res, point = 0, 0
        for i in set(nums):
            cur = nums.count(i)
            if cur > len(nums) / 2 and cur > point:
                res, point = i, cur
        return res